UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dnaAEpPNYnws+NUGg1/GG9VB1dCu8BBzptN+1Ktg9Jw=' 
WHERE 
  key_id = '23b3566704f9f9755c6f95dc4e4445bf70d75d248a9f1cf9935664420fa9e914' 
  AND (
    token = 'dnaAEpPNYnws+NUGg1/GG9VB1dCu8BBzptN+1Ktg9Jw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024