UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2TPJaoqLp5VJdD4JjCL/gN+5WQo4hS7VKLssXKvv1So='
WHERE
key_id = 'f5be522a4b33064f9a2e691f583cce7e1b0a33f1b2d237f57c0ed51732812758'
AND (
token = '2TPJaoqLp5VJdD4JjCL/gN+5WQo4hS7VKLssXKvv1So='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)