UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hBgNsCdi+/di1V/Kdg3H2d1laZtogEuBYKCqVEumKn0='
WHERE
key_id = '93336c0fd547231c3c19b9ef191fa0426d334dbef631ac8aeb33f41494fe00f2'
AND (
token = 'hBgNsCdi+/di1V/Kdg3H2d1laZtogEuBYKCqVEumKn0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)