UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CSxgEPDFPuhGGYzNcjkfCMhQWcDqMSuV3J2qw8BFZeQ='
WHERE
key_id = '45846f09f7690ea832a42007f9eeae764fcedb534a17c6ecb3898131c47dab97'
AND (
token = 'CSxgEPDFPuhGGYzNcjkfCMhQWcDqMSuV3J2qw8BFZeQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)