UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'j5Kr5FuvojznOuAddhWBdRB4lm877x619bGa8siO3BA='
WHERE
key_id = '70130591d0f2b4e8da890fbf0f6316d1bffc5c890ff678baed4c947758d54f6d'
AND (
token = 'j5Kr5FuvojznOuAddhWBdRB4lm877x619bGa8siO3BA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)