UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xpkz593TTzp7/htYVkXpf0FNcfuCP0NeW28vyrW47J0='
WHERE
key_id = '73cef674dfbbdeee29acef21cd873015577eb70d932d5cc450f84526b224180b'
AND (
token = 'xpkz593TTzp7/htYVkXpf0FNcfuCP0NeW28vyrW47J0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)