UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0GQH/K94tmpZcmMTZIj+3nKzgx49Kbrk4fgpDkx6rhY='
WHERE
key_id = 'b6c5a5340520d830bfd6c3e88012309401b98d05b199d3a44c992be37b27cae1'
AND (
token = '0GQH/K94tmpZcmMTZIj+3nKzgx49Kbrk4fgpDkx6rhY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)