UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pyZuXy+39snVIUDIlGTBvNzPGQ+6IZuDBdcTo2H+0Q8='
WHERE
key_id = 'da72385257d32b7f476d02d5e1dbe965213c24d652009cb5866c1517b8721c03'
AND (
token = 'pyZuXy+39snVIUDIlGTBvNzPGQ+6IZuDBdcTo2H+0Q8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)