UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZKsdb8zG5saTwPKoTa36MsaYQGJnypJF82ToNlEFYFY=' 
WHERE 
  key_id = '4da98df29e4022a5b9d1f1ede6ac8cd800b229dbc710c7422df25ec14ea316f3' 
  AND (
    token = 'ZKsdb8zG5saTwPKoTa36MsaYQGJnypJF82ToNlEFYFY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043