UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2BJRSA/cGr6tpfqsA05KMXf00YGgP1MJc7ldmqFrFMM='
WHERE
key_id = '2c47eeacda52ebdcb8856b9da4fcdb1849b87d74cd7fae0254cecdff3362c8c6'
AND (
token = '2BJRSA/cGr6tpfqsA05KMXf00YGgP1MJc7ldmqFrFMM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)