UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '27RCCVZ6u2dK8rv0xZ2sGhbIwOqjbBj8wnOqL0ADEpM='
WHERE
key_id = '7cc549489e8e45bd9ce73fee1cffc5cdc28a609e22fa89e1dc769e55d5d15212'
AND (
token = '27RCCVZ6u2dK8rv0xZ2sGhbIwOqjbBj8wnOqL0ADEpM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)