UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Mdr0iC20WYUGa/MDSSdX340oiovRTZY0+GnhduURdn8='
WHERE
key_id = '771fe9d8f8520d5815171b56190dc19308055d19e3c3c96a40db330327f21344'
AND (
token = 'Mdr0iC20WYUGa/MDSSdX340oiovRTZY0+GnhduURdn8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)