UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'l4l8GV+PFKThzC5pQ3+M4rL0PdZEmRJhMaJDoVstIEM='
WHERE
key_id = '06c9d2a95e72503f91f2a0fbf76602227a218f114631eda09ae868ba48a12c42'
AND (
token = 'l4l8GV+PFKThzC5pQ3+M4rL0PdZEmRJhMaJDoVstIEM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)