UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sQGtMXy7TRGsE1BMkYrODh0NzHEDKYj/zLlVu8nUEV0='
WHERE
key_id = 'dc1546181ffb4e095bfe96e0dbc918272620a4bf81c7417e5785f21ba504625b'
AND (
token = 'sQGtMXy7TRGsE1BMkYrODh0NzHEDKYj/zLlVu8nUEV0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)