UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6Bo1l7TE/tt3rOONeMPPqvEZz4tg5QZeEgq84UYeqQk='
WHERE
key_id = '3bcd4ed6763822bd078cc248ebcddb5bb65f2646fb25ced7e62aac0d3a2ef847'
AND (
token = '6Bo1l7TE/tt3rOONeMPPqvEZz4tg5QZeEgq84UYeqQk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)