UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6g7uvQBRgIMBH2W+z+u1e1mb8BYbkjDYOKT0SCxNbfQ='
WHERE
key_id = '1dc10b97b6b0e16681ead3234a0ffe391d5a4546cb603e1976337435a709dd59'
AND (
token = '6g7uvQBRgIMBH2W+z+u1e1mb8BYbkjDYOKT0SCxNbfQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)