UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/vhVcitSQYPgqoppDv8LrL5bsUoXDL+foMMqFj/sI/Y='
WHERE
key_id = 'a58fe14a935775db46bbf68eb462ec5809ea2c2f5d2d14a8b66ea9e56d2ebf74'
AND (
token = '/vhVcitSQYPgqoppDv8LrL5bsUoXDL+foMMqFj/sI/Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)