UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lKPE/Y9sXyL2Vp44wwz3+iFwUJBODhNqlS4AbnUSIHY=' 
WHERE 
  key_id = '5db1c4310456c86bb18cffe0c8d88abecab880346df3f8d96ed86090dd51ab06' 
  AND (
    token = 'lKPE/Y9sXyL2Vp44wwz3+iFwUJBODhNqlS4AbnUSIHY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033