UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '38PYT6vd7c5trDYiIC0yS7ozHp1aWh1IqIodoPmstqU='
WHERE
key_id = '3a1ac6f1258255fd64d03c6e5c176ff6b652c86a4e5cb40ed2c2a0496fabf9aa'
AND (
token = '38PYT6vd7c5trDYiIC0yS7ozHp1aWh1IqIodoPmstqU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)