UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OdHpjNAwAEVqbfOvdU3IrdsDSledXrluV9P5uIsQE8s='
WHERE
key_id = '72ef0de6d92996a143b5ee6076984a42a3feba4457b351dbb9e6c5917d2c2862'
AND (
token = 'OdHpjNAwAEVqbfOvdU3IrdsDSledXrluV9P5uIsQE8s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)