UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'w2aIY6YyEbnasEgjp3QN4gtm06Dk/Ejl+ICIwWKh5uc='
WHERE
key_id = '8d2e8bb1fcbd62aa0fc7b500ca9b3efa100380336d9ade2db2ac9e2747fbf10c'
AND (
token = 'w2aIY6YyEbnasEgjp3QN4gtm06Dk/Ejl+ICIwWKh5uc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)