UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gDoWNY6a7nlULIlJaUzO5H6pM3/rQ//QnRKSVWy8f8w='
WHERE
key_id = 'e36b81b76c66df83d9f50966a91e5fd145c8b7183648d78b3bc90e825555c4a5'
AND (
token = 'gDoWNY6a7nlULIlJaUzO5H6pM3/rQ//QnRKSVWy8f8w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)