UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IuKOgZbIPySXMOhWVuY0eylN536p+YFjOaXljZJoC8o=' 
WHERE 
  key_id = '20c217ec502bb7ccfa0d3ea430992209d773722afa0ef1013fd51c7c4804a2ef' 
  AND (
    token = 'IuKOgZbIPySXMOhWVuY0eylN536p+YFjOaXljZJoC8o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038