UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+FlVg2SBuVLDQb7Ai5gZtwp6Lll/Ta7akInBtLsKwGA=' 
WHERE 
  key_id = '03c3f4d0ce1721e11a7a66b7be0ea2371c9d1ad616dc5734c6dec7df118ce92c' 
  AND (
    token = '+FlVg2SBuVLDQb7Ai5gZtwp6Lll/Ta7akInBtLsKwGA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00072