UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PfImhjbo/BeHNfxmktIIY7ZNfQFPyMYC3nf/NzZbGvQ='
WHERE
key_id = 'e07038947b17f91f6cc6976317335bcb4aa7fb18310a7713060e7fec93473698'
AND (
token = 'PfImhjbo/BeHNfxmktIIY7ZNfQFPyMYC3nf/NzZbGvQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)