UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HfQALwjftgruwWQg29zSfCSKfP5S6WZHRx/Bd94Ac0I='
WHERE
key_id = 'c9b2cb5b2878b84df9e12fb6b79d71a90244bd6bd240e77cde7118d6d5c21c34'
AND (
token = 'HfQALwjftgruwWQg29zSfCSKfP5S6WZHRx/Bd94Ac0I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)