UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+VbU1gTl3kftMex5eCrXyDVP8NtZ0d1w7FpMBZOnxBg=' 
WHERE 
  key_id = '23e1721ec396c366e76076e51a3bf0218bbf47379c57f25e58d1259aed6659db' 
  AND (
    token = '+VbU1gTl3kftMex5eCrXyDVP8NtZ0d1w7FpMBZOnxBg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027