UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QUAAAtdDLd3ODjnftFiyH+w9MhQx8+A6VsEGhJV6cHQ='
WHERE
key_id = '09ab9bb448cd5bdb274888ce6f99b87fd7c82067c17b26c6af051deeaaf31ea5'
AND (
token = 'QUAAAtdDLd3ODjnftFiyH+w9MhQx8+A6VsEGhJV6cHQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)