UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GSCiYIifGuCG8GO/hHl++95EOA/FkqujXpnwqC+9JXw=' 
WHERE 
  key_id = '5f391e61c4dca1c75b0a41b11d087496b6b0539b5bcfd8ac791568fd801cd3f5' 
  AND (
    token = 'GSCiYIifGuCG8GO/hHl++95EOA/FkqujXpnwqC+9JXw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035