UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wvxxZ3YJewzzdCZaZTDjXfsVODmWhVwbZWAUt8vCWto='
WHERE
key_id = '5d9e7a23f5f6e5e28a759a68643de736dda1c644c73382ce03c2b0e264a1291f'
AND (
token = 'wvxxZ3YJewzzdCZaZTDjXfsVODmWhVwbZWAUt8vCWto='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)