UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7+cOtJjdOBmfQtxUOqHV340wfHISHZEiQZn9MXiY5HI=' 
WHERE 
  key_id = '789419608b71df603edf5beea25db5a2e553a32a7027395936a771f3aa6a0d91' 
  AND (
    token = '7+cOtJjdOBmfQtxUOqHV340wfHISHZEiQZn9MXiY5HI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021