UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TNtqEBCu8RIqQP4guj+UePdd29doQu1vI1bR+6r6lyc='
WHERE
key_id = '08ecf0155cbd34de056fa930573583b9f43a1cdd0f193d290e615450db66ca6c'
AND (
token = 'TNtqEBCu8RIqQP4guj+UePdd29doQu1vI1bR+6r6lyc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)