UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NAx3oZFXyz7jQD/pVPV5QIeb/PCPe0RHahT4ykosWkY=' 
WHERE 
  key_id = 'b02b937c2ae9276d1def09abc6cf72c08b3f59b3915dc94b3af52cc61a051841' 
  AND (
    token = 'NAx3oZFXyz7jQD/pVPV5QIeb/PCPe0RHahT4ykosWkY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049