UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'W7BxRIUwtGfn+95pL7Dpo1oJ43ZKWHWDZbbmXTy5ipY='
WHERE
key_id = '047483d5f412c7eda79d44a7d059226dd5f0b23ba74f302c100d0a3f60cd4e9b'
AND (
token = 'W7BxRIUwtGfn+95pL7Dpo1oJ43ZKWHWDZbbmXTy5ipY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)