UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'i9dCdQUhvcOFedUcOgv/ObAba/zzLPGAObRu+ZRBcmg=' 
WHERE 
  key_id = 'be936c4ba4ee39671fdb686bbedb0bd4f5d56effcca0d0fb7eb3f317383c180a' 
  AND (
    token = 'i9dCdQUhvcOFedUcOgv/ObAba/zzLPGAObRu+ZRBcmg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019