UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fBz6C8jjlNxdRKrN5PnMsUL6r0OuAvVMSuvKJWJ29e0='
WHERE
key_id = '919a6339240e102d31bf59f4e5730e59456fe88829795e5648a15989eb0c266c'
AND (
token = 'fBz6C8jjlNxdRKrN5PnMsUL6r0OuAvVMSuvKJWJ29e0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)