UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GQ9iNzMwig3eS1cPXmWfU8AaL+7lI7GqUoj2glx4uVE=' 
WHERE 
  key_id = '3c907d2600a9c0bd1f863a518188ed374d3dbf578dabe1d93450e38e7fd9555d' 
  AND (
    token = 'GQ9iNzMwig3eS1cPXmWfU8AaL+7lI7GqUoj2glx4uVE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031