UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8YvbuOHTwizoXJ/aESmdgoVBagPEAsP0OFfScJFLYeU=' 
WHERE 
  key_id = 'af280f2961c0c73abfe4ae5ba59c7b6327b1cbbfa78e739f6113585567d5bead' 
  AND (
    token = '8YvbuOHTwizoXJ/aESmdgoVBagPEAsP0OFfScJFLYeU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052