UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fjizSYxAMeB2waMomlV7F5OXMCOjnlxEdQMU68LLxDg='
WHERE
key_id = 'b2d4679d9cf794d93a2e9415bd525dc814297e42a49e4d1a16050bc4f1906eb3'
AND (
token = 'fjizSYxAMeB2waMomlV7F5OXMCOjnlxEdQMU68LLxDg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)