UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'J8OnqIUIkd6aITcpdjCQnuF/FOCmRDD0lgvanu5uvWo=' 
WHERE 
  key_id = 'e53e64978c44e288c6fb5cb41f92ddde6414a49bfcf3c74dbf6eb27e9d77084d' 
  AND (
    token = 'J8OnqIUIkd6aITcpdjCQnuF/FOCmRDD0lgvanu5uvWo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024