UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'peVfoPsfiJ0NG7RNkBRY3j50Fh0TLxKyBTXIkgkL+L8='
WHERE
key_id = '7c339163550ccf2faeacbd2da8961c72da50dc30874f559938f37e0c47b5c2a8'
AND (
token = 'peVfoPsfiJ0NG7RNkBRY3j50Fh0TLxKyBTXIkgkL+L8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)