UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yNRPFsmK3riznuhODvBccd1wj6fcL8kDoLcHpJ1BnqA='
WHERE
key_id = '05918941444c5ebc1ea6a3803eb215e0deaf1a6b9d8238d011b485027f0e2dac'
AND (
token = 'yNRPFsmK3riznuhODvBccd1wj6fcL8kDoLcHpJ1BnqA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)