UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZGG0gMsNLVe7VQqDxTPZlOUSaTKtymUbn0zyeSqDNNQ='
WHERE
key_id = '5ecd8c20cc8aba48ce3251d72f512aa0ba5cfac1fda56b323b883b511c968850'
AND (
token = 'ZGG0gMsNLVe7VQqDxTPZlOUSaTKtymUbn0zyeSqDNNQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)